agents.anac.y2011.HardHeaded
Class BidHistory

java.lang.Object
  extended by agents.anac.y2011.HardHeaded.BidHistory

public class BidHistory
extends java.lang.Object

Keeps track of all bids exchanged by both the agent and its opponent. Also has some tools that work on history of exchanged bids.


Constructor Summary
BidHistory(UtilitySpace utilSpace)
          BidHistory class constructor.
 
Method Summary
 void addMyBid(java.util.Map.Entry<java.lang.Double,Bid> pBid)
          Adds a new bid Map.Entry to the end of agent's own bids.
 void addOpponentBid(Bid pBid)
          Adds a new bid Map.Entry to the end of oppenent's bids.
 java.util.HashMap<java.lang.Integer,java.lang.Integer> BidDifference(Bid first, Bid second)
          receives two bids as arguments and returns a HashMap that contains for each issue whether or not its value is different between the two bids.
 java.util.HashMap<java.lang.Integer,java.lang.Integer> BidDifferenceofOpponentsLastTwo()
          For the last two bids of the opponent returns a HashMap that contains for each issue whether or not its value is different between the two bids.
 java.util.Map.Entry<java.lang.Double,Bid> getMyBid(int pIndex)
          retrieves a bid Map.Entry from the agent's bid list
 int getMyBidCount()
           
 java.util.Map.Entry<java.lang.Double,Bid> getMyLastBid()
          retrieves last bid Map.Entry from the agent's bid list
 Bid getOpponentBid(int pIndex)
          retrieves a bid from the opponent's bid list
 int getOpponentBidCount()
           
 Bid getOpponentLastBid()
          retrieves last bid from the opponent's bid list
 Bid getOpponentSecondLastBid()
          retrieves second last bid from the opponent's bid list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BidHistory

public BidHistory(UtilitySpace utilSpace)
BidHistory class constructor.

Parameters:
utilSpace - a UtilitySpace to be set for utility calculations of stored bids.
Method Detail

addMyBid

public void addMyBid(java.util.Map.Entry<java.lang.Double,Bid> pBid)
Adds a new bid Map.Entry to the end of agent's own bids.

Parameters:
pBid - passed bid entry

getMyBidCount

public int getMyBidCount()
Returns:
the size (number) of offers already made

getMyBid

public java.util.Map.Entry<java.lang.Double,Bid> getMyBid(int pIndex)
retrieves a bid Map.Entry from the agent's bid list

Parameters:
pIndex - index of the bid
Returns:
a bid from the list

getMyLastBid

public java.util.Map.Entry<java.lang.Double,Bid> getMyLastBid()
retrieves last bid Map.Entry from the agent's bid list

Returns:
a bid from the list

addOpponentBid

public void addOpponentBid(Bid pBid)
Adds a new bid Map.Entry to the end of oppenent's bids.

Parameters:
pBid - passed bid entry

getOpponentBidCount

public int getOpponentBidCount()
Returns:
the number of bids the opponent has made

getOpponentBid

public Bid getOpponentBid(int pIndex)
retrieves a bid from the opponent's bid list

Parameters:
pIndex - index of the bid
Returns:
a bid from the list

getOpponentLastBid

public Bid getOpponentLastBid()
retrieves last bid from the opponent's bid list

Returns:
a bid from the list

getOpponentSecondLastBid

public Bid getOpponentSecondLastBid()
retrieves second last bid from the opponent's bid list

Returns:
a bid from the list

BidDifference

public java.util.HashMap<java.lang.Integer,java.lang.Integer> BidDifference(Bid first,
                                                                            Bid second)
receives two bids as arguments and returns a HashMap that contains for each issue whether or not its value is different between the two bids.

Parameters:
first -
second -
Returns:
a HashMap with keys equal to issue IDs and with values 1 if different issue value observed and 0 if not.

BidDifferenceofOpponentsLastTwo

public java.util.HashMap<java.lang.Integer,java.lang.Integer> BidDifferenceofOpponentsLastTwo()
For the last two bids of the opponent returns a HashMap that contains for each issue whether or not its value is different between the two bids.

Returns:
a HashMap with keys equal to issue IDs and with values 1 if different issue value observed and 0 if not.